<?php
 Session_Start () ;
 If (!$_SESSION ["repertoire_config"]) { Header ("Location: ../../sortie.php?sortie=3") ; }
 Include ($_SESSION ["repertoire_config"]."/garennes.cfg") ;
 Include ($_SESSION ["repertoire_config"]."/init.php") ;
 Include ("../include/config.inc") ;
 verif_droits ($droit_courant, $_SESSION ["code"]) ;
 
 Include ("../../include/var_temp.inc") ;
 
 $nombre_caracteres_id = 9 ;
 
 $maj = 0 ;
 If (IsSet ($attribution))
  {
   $utils = $attribution ;
   Switch ($attribution)
    {
     // Eleves
     Case 1 : $resultats = SQL_commande ("SELECT * FROM eleves WHERE exterieur='0' ORDER BY nom,prenoms", $id_sql) ;
	      $nombre_maj = SQL_nbr_lignes ($resultats) ;
              For ($i = 0 ; $i < $nombre_maj ; $i++)
               {
		$r = SQL_tableau_associatif ($resultats, "") ;
                $nom = "" ;
	        If ($meth_1) { $nom .= SubStr ($r ["$meth_1"], 0, $nbr_1) ; }
		If (($sep_1) And ($nom != "")) { $nom .= $sep_1 ; }
		If ($meth_2) { $nom .= SubStr ($r ["$meth_2"], 0, $nbr_2) ; }
		If (($sep_2) And ($nom != "")) { $nom .= $sep_2 ; }
		If ($meth_3) { $nom .= SubStr ($r ["$meth_3"], 0, $nbr_3) ; }
		If (($sep_3) And ($nom != "")) { $nom .= $sep_3 ; }
		If ($meth_4) { $nom .= SubStr ($r ["$meth_4"], 0, $nbr_4) ; }
		If ($min_log) { $nom = StrToLower ($nom) ; }
		$nom = SubStr (Str_Replace (" ", "_", $nom), 0, $taille) ;
		$passe = passe_mnemo ($mdp) ;
		If ($min_mdp) { $passe = StrToLower ($passe) ; }
		
		SQL_commande ("UPDATE eleves SET login='".$nom."',passe='".$passe."'
                               WHERE id_eleve='".$r ["id_eleve"]."' LIMIT 1", $id_sql) ;
	       }
	      $maj = 1 ;
	      Break ;
     // Professeurs
     Case 2 : $resultats = SQL_commande ("SELECT * FROM utilisateurs WHERE droits='".$droit_prof."' ORDER BY nom,prenom", $id_sql) ;
	      $nombre_maj = SQL_nbr_lignes ($resultats) ;
              For ($i = 0 ; $i < $nombre_maj ; $i++)
               {
	        $r = SQL_tableau_associatif ($resultats, "") ;
	        $nom = "" ;
	        If ($meth_1) { $nom .= SubStr ($r ["$meth_1"], 0, $nbr_1) ; }
		If (($sep_1) And ($nom != "")) { $nom .= $sep_1 ; }
		If ($meth_2) { $nom .= SubStr ($r ["$meth_2"], 0, $nbr_2) ; }
		If (($sep_2) And ($nom != "")) { $nom .= $sep_2 ; }
		If ($meth_3) { $nom .= SubStr ($r ["$meth_3"], 0, $nbr_3) ; }
		If ($min_log) { $nom = StrToLower ($nom) ; }
		$nom = SubStr (Str_Replace (" ", "_", $nom), 0, $taille) ;
		$passe = passe_mnemo ($mdp) ;
		If ($min_mdp) { $passe = StrToLower ($passe) ; }
		$ok = SQL_commande ("UPDATE utilisateurs SET login='".$nom."',passe='".$passe."' WHERE id_utilisateur='".$r ["id_utilisateur"]."' LIMIT 1", $id_sql) ;
	       }
	      $maj = 1 ;
	      Break ;
    }
  }
 
 $resultats = SQL_commande ("SELECT * FROM menus WHERE numero='".$droit_courant."' AND ordre='0'", $id_sql) ;
 $l = SQL_tableau_associatif ($resultats, "") ;
 
 Echo "<HTML><HEAD>" ;
 entete_html ("Garennes - Attribution identifiants/mot de passes", "", 1) ;
 Echo styles ("none", "none", "none", $l ["lien"], "none") ;
 Echo "</HEAD>" ;

 Echo "<BODY BACKGROUND=\"../images/fond.png\" TEXT=\"".$l ["couleur_texte"]."\" OnContextMenu=\"return false\">" ;
 Echo "<CENTER><FONT COLOR=\"#0000FF\">&nbsp;Attribution&nbsp;des&nbsp;identifiants/mots&nbsp;de&nbsp;passe&nbsp;" ;
 Switch ($utils)
  {
   Case  1 : Echo "&eacute;l&egrave;ves" ;
             If ($maj == 1) { $utils = 3 ; } Else { $utils = 1 ; }
	     Break ;
   Case  2 : Echo "professeurs" ;
             If ($maj == 1) { $utils = 3 ; } Else { $utils = 2 ; }
	     Break ;
   Default : Echo "&eacute;l&egrave;ves" ; $utils = 1 ;  Break ;
  }
 Echo "&nbsp;</FONT></CENTER>" ;
 
 Switch ($utils)
  {
   Case  1 :  Echo "<FORM ACTION=\"./def_identifiants.php\" METHOD=\"POST\">" ;
              Echo "<TABLE BORDER=\"1\" ALIGN=\"CENTER\" BGCOLOR=\"".$l ["couleur_fond"]."\" CELLPADDING=\"0\" CELLSPACING=\"0\" style=\"border-collapse:collapse\">" ;
	      Echo "<TR><TD><TABLE BORDER=\"0\" ALIGN=\"CENTER\" BGCOLOR=\"".$l ["couleur_fond"]."\" CELLPADDING=0 CELLSPACING=0>" ;
	      Echo "<TR>" ;
	      Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ROWSPAN=5 VALIGN=MIDDLE ALIGN=CENTER><B><BR>M<BR>&Eacute;<BR>T<BR>H<BR>O<BR>D<BR>E<BR><BR>1<BR></B></TD>" ;
              Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ALIGN=CENTER>&nbsp;Attribution&nbsp;des&nbsp;identifiants&nbsp;</TD>" ;
	      Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ROWSPAN=5 VALIGN=MIDDLE ALIGN=CENTER><B><BR>M<BR>&Eacute;<BR>T<BR>H<BR>O<BR>D<BR>E<BR><BR>1<BR></B></TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD>" ;
              Echo "<INPUT TYPE=HIDDEN NAME=\"attribution\" VALUE=\"1\">" ;
              Echo "<TABLE BORDER=0 WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR><TD COLSPAN=8>&nbsp;</TD></TR>" ;
              Echo "<TD ALIGN=RIGHT vALIGN=MIDDLE ROWSPAN=3>&nbsp;Choisir&nbsp;un&nbsp;nom&nbsp;personnalis&eacute;&nbsp;:&nbsp;</TD>" ;
              Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_1\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\" SELECTED>Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenoms\">Pr&eacute;nom</OPTION>" ;
              Echo "<OPTION VALUE=\"code_classe\">Code classe</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=MIDDLE ROWSPAN=2>" ;
              Echo "<SELECT NAME=\"sep_1\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"_\">_(underscore)</OPTION>" ;
              Echo "<OPTION VALUE=\"-\">-(trait)</OPTION>" ;
              Echo "<OPTION VALUE=\".\">.(point)</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_2\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\">Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenoms\">Pr&eacute;nom</OPTION>" ;
	      Echo "<OPTION VALUE=\"code_classe\">Code classe</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=MIDDLE ROWSPAN=2>" ;
              Echo "<SELECT NAME=\"sep_2\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"_\">_(underscore)</OPTION>" ;
              Echo "<OPTION VALUE=\"-\">-(trait)</OPTION>" ;
              Echo "<OPTION VALUE=\".\">.(point)</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_3\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\">Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenoms\">Pr&eacute;nom</OPTION>" ;
	      Echo "<OPTION VALUE=\"code_classe\">Code classe</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=MIDDLE ROWSPAN=2>" ;
              Echo "<SELECT NAME=\"sep_3\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"_\">_(underscore)</OPTION>" ;
              Echo "<OPTION VALUE=\"-\">-(trait)</OPTION>" ;
              Echo "<OPTION VALUE=\".\">.(point)</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_4\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"repere1\">Num&eacute;ro GEP (obsol&egrave;te)</OPTION>" ;
              Echo "<OPTION VALUE=\"repere2\">Num&eacute;ro National &Eacute;l&egrave;ve</OPTION>" ;
	      Echo "<OPTION VALUE=\"repere3\">Num&eacute;ro identification SCONET</OPTION>" ;
              Echo "<OPTION VALUE=\"id_eleve\">Num&eacute;ro identification base Garennes</OPTION>" ;
              Echo "</SELECT>&nbsp;" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR>" ;
              Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_1\">" ;
              Echo "B<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
	        Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_2\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
	        Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_3\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
	      Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_4\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=8>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=RIGHT>&nbsp;Taille&nbsp;maximum&nbsp;:&nbsp;</TD>" ;
	      Echo "<TD ALIGN=LEFT COLSPAN=7>" ;
	      Echo "<SELECT NAME=\"taille\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout&nbsp;prendre</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;caract&egrave;re" ; If ($i > 1) { Echo "s" ; }
		Echo "&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
	      Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=8>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=RIGHT><INPUT TYPE=CHECKBOX NAME=min_log VALUE=\"1\" CHECKED></TD>" ;
	      Echo "<TD ALIGN=LEFT COLSPAN=7>&nbsp;En&nbsp;minuscules&nbsp;</TD>" ;
	      Echo "</TR>" ;
              Echo "<TR><TD COLSPAN=8>&nbsp;</TD></TR>" ;
	      Echo "</TABLE>" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ALIGN=CENTER>&nbsp;Attribution&nbsp;des&nbsp;mots&nbsp;de&nbsp;passe&nbsp;</TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD ALIGN=CENTER>" ;
	      Echo "G&eacute;n&eacute;ration&nbsp;des&nbsp;mots&nbsp;de&nbsp;passe&nbsp;al&eacute;atoirement." ;
              Echo "<TABLE BORDER=0 WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
              Echo "<TD ALIGN=RIGHT>&nbsp;Nombre&nbsp;de&nbsp;caract&egrave;res&nbsp;:&nbsp;</TD>" ;
              Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"mdp\">" ;
	      For ($i = 5 ; $i < 21 ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
              Echo "</TD></TR>" ;
	      Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
	      Echo "<TR><TD ALIGN=RIGHT><INPUT TYPE=CHECKBOX NAME=min_mdp VALUE=\"1\"></TD><TD ALIGN=LEFT>&nbsp;En&nbsp;minuscules&nbsp;</TD></TR>" ;
              Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
              Echo "</TABLE></TD></TR>" ;
	      Echo "<TR><TD ALIGN=CENTER><INPUT TYPE=IMAGE SRC=\"../images/valider.png\"></TD></TR>" ;
	      Echo "<TR><TD COLSPAN=3 BGCOLOR=\"".$l ["lien"]."\">&nbsp;</TD></TR>" ;
              Echo "</TABLE>" ;
	      Echo "</TD></TR></TABLE>" ;
	      Echo "</FORM>" ;
	      Break ;
   Case  2 :  Echo "<FORM ACTION=\"./def_identifiants.php\" METHOD=\"POST\">" ;
              Echo "<TABLE BORDER=1 ALIGN=CENTER BGCOLOR=\"".$l ["couleur_fond"]."\" CELLPADDING=0 CELLSPACING=0 style=\"border-collapse:collapse\">" ;
	      Echo "<TR><TD><TABLE BORDER=0 ALIGN=CENTER BGCOLOR=\"".$l ["couleur_fond"]."\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR>" ;
	      Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ROWSPAN=5 VALIGN=MIDDLE ALIGN=CENTER><B><BR>M<BR>&Eacute;<BR>T<BR>H<BR>O<BR>D<BR>E<BR><BR>1<BR></B></TD>" ;
              Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ALIGN=CENTER>&nbsp;Attribution&nbsp;des&nbsp;identifiants&nbsp;</TD>" ;
	      Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ROWSPAN=5 VALIGN=MIDDLE ALIGN=CENTER><B><BR>M<BR>&Eacute;<BR>T<BR>H<BR>O<BR>D<BR>E<BR><BR>1<BR></B></TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD>" ;
              Echo "<INPUT TYPE=HIDDEN NAME=\"attribution\" VALUE=\"2\">" ;
              Echo "<TABLE BORDER=0 WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR><TD COLSPAN=6>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
              Echo "<TD ALIGN=RIGHT vALIGN=MIDDLE ROWSPAN=2>&nbsp;Choisir&nbsp;un&nbsp;nom&nbsp;personnalis&eacute;&nbsp;:&nbsp;</TD>" ;
              Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_1\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\" SELECTED>Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenom\">Pr&eacute;nom</OPTION>" ;
              Echo "<OPTION VALUE=\"numen\">Num&eacute;ro SCONET</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=MIDDLE ROWSPAN=2>" ;
              Echo "<SELECT NAME=\"sep_1\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"_\">_(underscore)</OPTION>" ;
              Echo "<OPTION VALUE=\"-\">-(trait)</OPTION>" ;
              Echo "<OPTION VALUE=\".\">.(point)</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_2\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\">Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenom\">Pr&eacute;nom</OPTION>" ;
	      Echo "<OPTION VALUE=\"numen\">Num&eacute;ro SCONET</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=MIDDLE ROWSPAN=2>" ;
              Echo "<SELECT NAME=\"sep_2\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"_\">_(underscore)</OPTION>" ;
              Echo "<OPTION VALUE=\"-\">-(trait)</OPTION>" ;
              Echo "<OPTION VALUE=\".\">.(point)</OPTION>" ;
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"meth_3\">" ;
              Echo "<OPTION VALUE=\"0\"></OPTION>" ;
              Echo "<OPTION VALUE=\"nom\">Nom</OPTION>" ;
              Echo "<OPTION VALUE=\"prenom\">Pr&eacute;nom</OPTION>" ;
	      Echo "<OPTION VALUE=\"numen\">Num&eacute;ro SCONET</OPTION>" ;
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR>" ;
              Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_1\">" ;
              Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
	        Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_2\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
	        Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>" ;
	      Echo "</TD>" ;
	      Echo "<TD ALIGN=CENTER vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"nbr_3\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;car.&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=6>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=RIGHT>&nbsp;Taille&nbsp;maximum&nbsp;:&nbsp;</TD>" ;
	      Echo "<TD ALIGN=LEFT COLSPAN=5>" ;
	      Echo "<SELECT NAME=\"taille\">" ;
	      Echo "<OPTION VALUE=\"200\">Tout&nbsp;prendre</OPTION>" ;
	      For ($i = 1 ; $i <= $nombre_caracteres_id ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."&nbsp;caract&egrave;re" ; If ($i > 1) { Echo "s" ; }
		Echo "&nbsp;</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
	      Echo "</TD>" ;
	      Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=6>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=RIGHT><INPUT TYPE=CHECKBOX NAME=min_log VALUE=\"1\" CHECKED></TD>" ;
	      Echo "<TD ALIGN=LEFT COLSPAN=5>&nbsp;En&nbsp;minuscules&nbsp;</TD>" ;
	      Echo "</TR>" ;
              Echo "<TR><TD COLSPAN=6>&nbsp;</TD></TR>" ;
	      Echo "</TABLE>" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ALIGN=CENTER>&nbsp;Attribution&nbsp;des&nbsp;mots&nbsp;de&nbsp;passe&nbsp;</TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
	      Echo "<TD ALIGN=CENTER>" ;
	      Echo "G&eacute;n&eacute;ration&nbsp;des&nbsp;mots&nbsp;de&nbsp;passe&nbsp;al&eacute;atoirement." ;
              Echo "<TABLE BORDER=0 WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
              Echo "<TD ALIGN=RIGHT>&nbsp;Nombre&nbsp;de&nbsp;caract&egrave;res&nbsp;:&nbsp;</TD>" ;
              Echo "<TD vALIGN=BOTTOM>" ;
              Echo "<SELECT NAME=\"mdp\">" ;
	      For ($i = 5 ; $i < 21 ; $i++)
	       {
                Echo "<OPTION VALUE=\"".$i."\">".$i."</OPTION>" ;
	       }
              Echo "</SELECT>&nbsp;" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=RIGHT><INPUT TYPE=CHECKBOX NAME=min_mdp VALUE=\"1\"></TD>" ;
	      Echo "<TD ALIGN=LEFT>&nbsp;En&nbsp;minuscules&nbsp;</TD>" ;
	      Echo "</TR>" ;
              Echo "<TR><TD COLSPAN=2>&nbsp;</TD></TR>" ;
              Echo "</TABLE>" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
	      Echo "<TR>" ;
	      Echo "<TD ALIGN=CENTER><INPUT TYPE=IMAGE SRC=\"../images/valider.png\"></TD>" ;
	      Echo "</TR>" ;
	      Echo "<TR><TD COLSPAN=3 BGCOLOR=\"".$l ["lien"]."\">&nbsp;</TD></TR>" ;
              Echo "</TABLE>" ;
	      Echo "</TD>" ;
	      Echo "</TR>" ;
	      Echo "</TABLE>" ;
	      Echo "</FORM>" ;
	      Break ;
   Case  3 :  Echo "<TABLE BORDER=1 ALIGN=CENTER BGCOLOR=\"".$l ["couleur_fond"]."\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR>" ;
              Echo "<TD BGCOLOR=\"".$l ["lien"]."\" ALIGN=CENTER>&nbsp;Rapport&nbsp;d'attribution&nbsp;des&nbsp;identifiants/mots&nbsp;de&nbsp;passe&nbsp;</TD>" ;
              Echo "</TR>" ;
              Echo "<TR>" ;
              Echo "<TD>" ;
              Echo "<TABLE BORDER=0 WIDTH=\"100%\" CELLPADDING=0 CELLSPACING=0>" ;
              Echo "<TR><TD>&nbsp;</TD></TR>" ;
              Echo "<TR><TD ALIGN=CENTER>&nbsp;<B>Nombre&nbsp;d'attribution</B>&nbsp;:&nbsp;".$nombre_maj."&nbsp;</TD></TR>" ;
	      Echo "<TR><TD>&nbsp;</TD></TR>" ;
              Echo "</TABLE>" ;
              Echo "</TD>" ;
              Echo "</TR>" ;
              Echo "</TABLE>" ;
	      Break ;
  }
 Echo "</BODY></HTML>" ;
?>